package com.bwie.controller;

import com.bwie.domain.Price;
import com.bwie.domain.PriceDetail;
import com.bwie.service.PriceService;
import com.bwie.utils.R;
import com.bwie.vo.AddPriceVo;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: lrz
 * @Date: 2024/10/31 17:41
 * @Description:
 **/
@RestController
@RequestMapping("/price/price")
public class PriceController {

    @Autowired
    PriceService priceService;

    @PostMapping("/shopListEs")
    public R shopListEs(@RequestBody PageInfoVo pageInfoVo){
        return priceService.shopListEs(pageInfoVo);
    }

    @PostMapping("/priceList")
    public R priceList(@RequestBody PageInfoVo pageInfoVo){
        return priceService.priceList(pageInfoVo);
    }

    @PostMapping("/addPrice")
    public R addPrice(@RequestBody AddPriceVo addPriceVo){
        return priceService.addPrice(addPriceVo);
    }

    @PostMapping("/getPriceById/{id}")
    public R getPriceById(@PathVariable("id") Integer id){
        return priceService.getPriceById(id);
    }

    //修改状态
    @PostMapping("/updateFlag")
    public R updateFlag(@RequestBody Price price){
        return priceService.updateFlag(price);
    }

    //调价单明细列表
    @PostMapping("/priceDetailList")
    public R priceDetailList(@RequestBody PageInfoVo pageInfoVo){
        return priceService.priceDetailList(pageInfoVo);
    }

}
